package com.pishou.code.util;

import android.content.BroadcastReceiver;
import android.content.Context;
import android.content.Intent;

import com.pishou.player.TextureActivity;

public class BootUpReceiver extends BroadcastReceiver {

    private final String ACTION_BOOT = "android.intent.action.BOOT_COMPLETED";

    @Override
    public void onReceive(Context context, Intent intent) {
        /**
         * 如果 系统 启动的消息，则启动 APP 主页活动----开机自启动
         */
        if (ACTION_BOOT.equals(intent.getAction())) {
            Intent intentMainActivity = new Intent(context, TextureActivity.class);
            intentMainActivity.addFlags(Intent.FLAG_ACTIVITY_NEW_TASK);
            context.startActivity(intentMainActivity);
        }
    }
}
